#ifndef NVPANEL_H
#define NVPANEL_H

#include <QObject>
#include <string>
#include "nvml.h"
#include <QTimer>

class NvPanel : public QObject {
    Q_OBJECT
    Q_PROPERTY(QString getGpuName READ getGpuName NOTIFY utilChanged)
    Q_PROPERTY(QString getGpuUtilization READ getGpuUtilization NOTIFY utilChanged)
    Q_PROPERTY(QString getMemoryUtilization READ getMemoryUtilization NOTIFY utilChanged)

public:
    explicit NvPanel(QObject *parent = nullptr);
    ~NvPanel();
    QString getGpuName() const;
    QString getGpuUtilization() const;
    QString getMemoryUtilization() const;
private:
    void updateUtilization();
    QTimer *timer = nullptr;

Q_SIGNALS:
    void utilChanged();
};

#endif // NVPANEL_H
